<?php $connection = mysql_connect("localhost","username","password"); if (!$connection) { die('Could not connect: ' . mysql_error()); }
 if (mysql_query("CREATE DATABASE my_database",$connection)) 
 { echo "Database successfully created"; } else { echo "Database could not be created: " . mysql_error(); } 
  mysql_select_db("my_database", $connection); $sql = "CREATE TABLE Subscribers ( EmailAddress varchar(35) )";
  mysql_query($sql,$connection); mysql_close($connection); ?>
  
  <form action="postemail.php" method="post"> Email Address:<input type="text" name="emailaddress" />
  <input type="submit" /> </form>
  
   <?php $connection = mysql_connect("localhost","username","password"); 
   if (!$connection) { die('Could not connect: ' . mysql_error()); } 
   mysql_select_db("my_database", $connection); $sql="INSERT INTO Subscribers (EmailAddress) VALUES ('$_POST[emailaddress]')"; 
   if (!mysql_query($sql,$connection)) { die('Error: ' . mysql_error()); } mysql_close($connection); ?>